package org.example.device.service;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.device.convert.DeviceRespMapperConvert;
import org.example.device.entity.resp.DeviceResp;
import org.example.device.repository.entity.DeviceDTO;
import org.example.domain.device.service.DeviceDomainService;
import org.example.base.entity.Result;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@RequiredArgsConstructor
public class DeviceAppService {

    private final DeviceDomainService deviceDomainService;

    private final DeviceRespMapperConvert deviceRespMapperConvert;
    public Result<DeviceResp> queryDevice(String id, String groupId){
        DeviceDTO deviceDTO = deviceDomainService.deviceHandle(id, groupId);
        return Result.OK(deviceRespMapperConvert.deviceDTO2DeviceResp(deviceDTO));
    }
}
